<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui"
	xmlns:r="http://ricchieri.com/facelets">
<h:head>
</h:head>
<h:body>


	<ui:composition template="../../templates/commonLayoutReservation.xhtml">
		<ui:define name="title">#{msg.cancelReservation}</ui:define>
		<ui:define name="content">
			<h2>#{msg.cancelReservation}</h2>
			<r:viewReservation manageBean="#{cancelReservationMB}" reservation="#{cancelReservationMB.reservation}"/>
			<h:form id="cancelationReservationForm">
				<p:messages showDetail="false" autoUpdate="true" closable="false"/>
				<h:panelGrid columns="3">
		     		<h:outputLabel value="#{msg.cancelationType}"/>
		     		<p:selectOneMenu id="cancelationType" value="#{cancelReservationMB.selectedCancelationType}">
	                	<f:selectItems value="#{cancelReservationMB.cancelationTypes}" />   
	            	</p:selectOneMenu> 
	            	<p:message id="cancelationTypeMsg" for="cancelationType"/>
	            	
					<h:outputLabel for="description" value="#{msg.cancelationDescription}" />
					<p:inputTextarea rows="12" style="width:99%" id="description" value="#{cancelReservationMB.cancelMotive.cancelationDescription}" 
						required="true"
						requiredMessage="#{msg.requiredDescription}" 
						title="#{component.valid ? '' : cancelReservationMB.getErrorMessage(component.clientId)}"
						maxlength="255" autoResize="false"/>
					<p:message id="descriptionMsg" for="description"/>				
					
					<h:outputText value="#{msg.blockUser}" />
					<p:selectBooleanCheckbox  value="#{cancelReservationMB.block}" id="blockUser"/>  					
					<p:message id="blockUserMsg" for="blockUser"/>
					
					<h:outputText value="#{msg.blockMotive}" />   
			       	<p:inputTextarea rows="7" style="width:98%" id="blockMotive" columns="30"
				       autoResize="false" value="#{cancelReservationMB.blockMotive}"
				       title="#{component.valid ? '' : cancelReservationMB.getErrorMessage(component.clientId)}"
				       maxlength="100"/>
			       	<p:message id="blockMotiveMsg" for="blockMotive"/>	
				</h:panelGrid>
				
				<h:panelGrid columns="2" style="margin-top:10px; text-align:center">
		     		<p:commandButton id="reset" value="#{msg.cancelButton}" action="#{cancelReservationMB.cancel}" update="@form" process="@this" styleClass="button-action green"/>
		     		<p:commandButton id="saveCancelation" value="#{msg.saveButton}" action="#{cancelReservationMB.saveCancelation}" ajax="false" styleClass="button-action green"/>
		     	 </h:panelGrid>
	     	 </h:form>
		</ui:define>
	</ui:composition>
</h:body>
</html>
